# Maintainer: Brett Cornwall <ainola@archlinux.org>
# Maintainer: Maxim Baz <$pkgname at maximbaz dot com>

pkgname=urlscan
pkgver=1.0.1
pkgrel=1
pkgdesc="Mutt and terminal url selector"
url="https://github.com/firecat53/urlscan"
arch=('any')
license=('GPL2')
depends=('python-urwid')
makedepends=(
    'python-build'
    'python-hatch-vcs'
    'python-hatchling'
    'python-installer'
    'python-wheel'
)
optdepends=(
    'xclip: Clipboard support for X11 environments'
    'wl-clipboard: Clipboard support for Wayland'
)
# Use PyPi release tarballs since the GitHub releases don't have version
# metadata
source=("$pkgname-$pkgver.tar.gz::https://pypi.io/packages/source/u/urlscan/urlscan-$pkgver.tar.gz")
sha256sums=('e0ec986e5aa2da57dd2face8692116d80af173d4eb56a78e4fd881731113307f')

build() {
    cd "$pkgname-$pkgver"
    python -m build --wheel --no-isolation
}

package() {
    cd "$pkgname-$pkgver"
    python -m installer --destdir="$pkgdir" dist/*.whl
    # Common licenses don't need to be copied over
    rm "$pkgdir/usr/share/doc/urlscan/LICENSE"
}
